package com.cxria.pattern.responsibilityChain

def rand = new Random()

def arrayList = []

(0..4).each{
    arrayList << new Women(rand.nextInt(4), '我要出去逛街')
}

def father = new Father()
def husband = new Husband()
def son = new Son()

father.next = husband
husband.next = son

arrayList.each { women ->
    father.handleMessage(women)
}